package com.example.aigc_education.exception;


import com.example.aigc_education.common.BusinessException;

public class RequestRepeatException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private final Integer code = 400;

    /**
     * 错误提示
     */
    private String message;

    /**
     * 错误明细，内部调试错误
     */
    private String detailMessage;

    /**
     * 空构造方法，避免反序列化问题
     */
    public RequestRepeatException(){}

    public RequestRepeatException(String message){
        this.message = message;
    }



    public String getDetailMessage(){
        return detailMessage;
    }

    @Override
    public String getMessage(){
        return message;
    }

    public Integer getCode(){
        return code;
    }

    /**
     * 设置错误提示
     * @param message 错误提示
     * @return this
     */
    public RequestRepeatException setMessage(String message){
        this.message = message;
        return this;
    }

    /**
     * 设置详细错误提示
     * @param detailMessage 详细错误提示
     * @return this
     */
    public RequestRepeatException setDetailMessage(String detailMessage){
        this.detailMessage = detailMessage;
        return this;
    }

}
